package com.suian.spring.thread;

public class T3Thread {
    static int flag = 1;
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            while (true) {
                System.out.println("TaskName: "+Thread.currentThread().getName()+" 运行了 "+(flag++)+"次");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        t1.start();
    }
}
